
#ifndef BLOCKINGSOCKET_H
#define BLOCKINGSOCKET_H

#include <QTcpSocket>
#include <QTime>

class BlockingSocket : public QTcpSocket
{

public:
	BlockingSocket( QObject * parent = 0 );

	void setTimeout(int timeout);
protected:
	virtual qint64 readData(char* data, qint64 maxlen);
	virtual qint64 writeData(const char* data, qint64 len);

private:
	int m_timeout;
};

#endif // BLOCKINGSOCKET_H
